<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        Function.prototype.myApply=function(context,...args){
            if (context===null||context===undefined) {
                return window
            }
            if (typeof context!=='object'&&typeof context!=='function') {
                context=Object(context) 
            }
            const sy1=Symbol('sy1')
            context[sy1]=this
            const re=context[sy1](...args)
            delete context[sy1]
            return re
        }
        function fn(a, b) {
            console.log(this,a + b);
        }
        console.log(fn.myApply({},1,2));
    </script>
</body>

</html>